<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/c" prefix="c" %>
<%@taglib prefix="display" uri="http://displaytag.sf.net/el"%>
<%@ page import="java.text.*"%>
<%@ page import="java.util.*"%>
<%@ page import="java.lang.*"%>
<%@ page import="com.solution.webconstant.PermissionConstants" %>

<%
	HashMap permissionMap = ((HashMap)(session.getAttribute("userPermissionsInfo")));
%>
<script language="JavaScript">
function fnSearch()
{
	document.examForm.action='/searchExam.do?';
	document.examForm.submit();
}
function fnEditViewExamDetails(exam_id_value, screen_type_value){
	document.examForm.screen_type.value=screen_type_value;
	document.examForm.exam_id.value=exam_id_value;
	document.examForm.action='/editViewExam.do?';
	document.examForm.submit();
}
function clearForm(formObj){
	var elements = formObj.elements;
	for(i=0; i<elements.length; i++){
		if(elements[i].type == "text")
			elements[i].value = "";
		if(elements[i].type == "select-one" || elements[i].type == "select-multiple")
			elements[i].selectedIndex = 0;
	}
}
</script>
<script language="JavaScript" src="js/Calendar.js" type="text/JavaScript"></script>
<html:form action="/searchExam">
	<html:hidden property="show_list" />
	<html:hidden property="screen_type" />
	<html:hidden property="exam_id" />
	<table width="90%" align="center" border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td>&nbsp;</td>
		</tr>
		<tr>
 			<td class="heading1">Exam Search Form</td>
		</tr>
		<tr>
			<td valign="top">&nbsp;</td>
		</tr>
		<tr>
			<td valign="top"><jsp:include page="showErrorMessage.jsp"/></td>
		</tr>
	  	<tr>
			<td>
				<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
					<tr>
						<td align="left" valign="top" class="inputtext">Name</td>
						<td valign="middle" ><input type="text" name="exam_name" id="exam_name" maxlength="30" class="form1" 
						value='<bean:write name="examForm" property="exam_name"/>'/></td>
						<td align="left" valign="top" class="inputtext">Status</td>
						<td valign="middle">
							<html:select styleClass="form3" property="status" styleId="status" style=":width=72%">
								<html:option value="">--Please Select--</html:option>
								<html:option value="2">Active</html:option>
								<html:option value="3">InActive</html:option>
							</html:select>
						</td>
					</tr>
  					<tr>
						<td height="25" colspan="4" valign="top"  >&nbsp;</td>
					</tr>
					<tr>
						<td colspan="4" valign="top"  bgcolor="#CCCCCC"><img src="images/zero.gif" width="1" height="1" /></td>
					</tr>
					<tr>
						<td height="25" colspan="4" align="center" valign="top" >&nbsp;</td>
					</tr>
					<tr>
       	 				<td height="25" colspan="4" align="center" valign="top">
       	 					<input type="button" class="imageButton" value="Search" onClick="JavaScript:fnSearch()">
       	 					<input type="button" class="imageButton" value="Reset" onClick="JavaScript:clearForm(this.form)">
       	 				</td>
      				</tr>
      				<tr>
						<td height="25" colspan="4" align="center" valign="top" >&nbsp;</td>
					</tr>
				</table>
          	</td>
		</tr>
		<tr>
			<td>
				<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
					<logic:equal name="examForm" property="show_list" value="Y">
					<tr>
						<td>
							<display:table name="examForm.exam_list" decorator="com.solution.decorator.ExamDecorator"
								export="false"	requestURI="/searchExam.do" cellspacing="0" cellpadding="0"
								pagesize="10" class="results" id="exam">
								<display:column property="id" title="ID" />
								<display:column property="name" title="Name" />
								<display:column property="description" title="Description" />
								<display:column property="time" title="Duration" />
								<logic:present property="status" name="exam">
								<bean:define id="displayStatus" property="status" name="exam"/>
								<display:column title="Status"><bean:message key="<%="Status."+displayStatus%>"/></display:column>
								</logic:present>
								<logic:equal name="examForm" property="screen_type" value="Edit">
									<display:column property="actionEdit" title="Action" />
								</logic:equal>
								<logic:equal name="examForm" property="screen_type" value="View">
									<display:column property="actionView" title="Action" />
								</logic:equal>
								<display:setProperty name="basic.msg.empty_list">&nbsp;</display:setProperty> 
							</display:table>
						</td>
            		</tr>
            		</logic:equal>
          		</table>
          	</td>
		</tr>
      </table>
</html:form>